﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Users
{
	/// <summary>
	/// 
	/// </summary>
	public interface IUserSnsService
	{
		/// <summary>
		/// 社交账号绑定信息是否存在。
		/// </summary>
		/// <param name="snsType">社交账号类型。</param>
		/// <param name="snsId">社交账号编号。</param>
		/// <returns></returns>
		bool Exists(SnsType snsType, string snsId);

		/// <summary>
		/// 获取社交账号绑定信息。
		/// </summary>
		/// <param name="snsType">社交帐号类型。</param>
		/// <param name="snsId">社交账号编号。</param>
		/// <returns></returns>
		UserSns GetUserSns(SnsType snsType, string snsId);

		/// <summary>
		/// 获取社交账号绑定信息。
		/// </summary>
		/// <param name="userId">用户编号。</param>
		/// <param name="snsType">社交账号类型。</param>
		/// <returns></returns>
		UserSns GetUserSns(int userId, SnsType snsType);

		/// <summary>
		/// 获取某个用户绑定的社交账号列表
		/// </summary>
		/// <param name="userId">用户编号</param>
		/// <returns></returns>
		List<UserSns> GetUserSnsList(int userId);

		/// <summary>
		/// 根据设计账号创建用户
		/// </summary>
		/// <param name="snsType">社交账号类型</param>
		/// <param name="snsId">社交账号编号</param>
		/// <param name="accessToken">访问令牌</param>
		/// <param name="snsNick">社交账号昵称</param>
		/// <returns></returns>
		UserSns CreateUser(SnsType snsType, string snsId, string accessToken, string snsNick);

		/// <summary>
		/// 绑定社交账号
		/// </summary>
		/// <param name="userId">用户编号</param>
		/// <param name="snsType">社交账号类型</param>
		/// <param name="snsId">社交账号编号</param>
		/// <param name="accessToken">访问令牌</param>
		/// <param name="snsNick">社交账号昵称</param>
		/// <returns></returns>
		UserSns BindUser(int userId, SnsType snsType, string snsId, string accessToken, string snsNick);

		/// <summary>
		/// 解除社交账号
		/// </summary>
		/// <param name="userId">用户编号</param>
		/// <param name="snsType">社交账号类型</param>
		void Unbind(int userId, SnsType snsType);

		/// <summary>
		/// 修改社交账号绑定信息
		/// </summary>
		/// <param name="userSns"></param>
		void UpdateUserSns(UserSns userSns);
	}
}
